package com.blabla.service.process;

import com.blabla.enums.CalculationType;
import com.blabla.factory.CalculationBeanFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;

/**
 * @author yzw
 * @date 2022/1/15 11:07
 * @desc 乘法
 */
@Slf4j
@Component
public class MulCalculationProcess implements CalculationProcess, InitializingBean {
    @Override
    public Integer calculationEasy(Integer firstNum, Integer secondNum) {
        return firstNum * secondNum;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        CalculationBeanFactory.registerCalculationProcess(CalculationType.MUL.getCode(), this);
    }
}
